<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>Spring Security</title>
</head>

<body>
<security:authentication var="user" property="principal"/>

<security:authorize access="isAnonymous()">
    <h2>You are not login</h2>
    <a href="${pageContext.request.contextPath}/login/Login.jsp">Login</a>
</security:authorize>

<security:authorize access="isAuthenticated()">
    <h2>Logged in as ${user.username}</h2>
    <a href="${pageContext.request.contextPath}/view/Admin.jsp">Admin</a>
    <a href="${pageContext.request.contextPath}/view/Client.jsp">Client</a>
</security:authorize>


</body>
</html>
